
<#include "*/general/header.ftl">
<script type="text/javascript" src="/Carrello/js/jquery-1.7.js"></script>

<h3>Add Product</h3>
<form id="input" action="addproduct.action" method="post" enctype="multipart/form-data">
<table id="productInformation" class="supa">
<input type="hidden" name="change" id="change" value="${change}"/>
<tr>
    <th scope="row" class="spec top">Category</th>
    <td class="top">
        <select name="categoryid" id="categorypicker">
            ${categories}
        </select>
    </td>
</tr>
<#list attributes as attribute>
    <tr>
        <th scope="row" class="spec">${attribute[0]}</th>
        <#if "${attribute[1]}" == "0" && "${attribute[2]}" == "String">
            <td ><input id="prod" name="values" type="text" class="niceinput"/></td>
        <#elseif "${attribute[1]}" == "1" && "${attribute[2]}" == "String">
            <td><input class="reqstring niceinput" name="values" type="text"/> </td>
        <#elseif "${attribute[1]}" == "1" && "${attribute[2]}" == "Double">
            <td><input class="reqdouble niceinput" name="values" type="text"/> </td>
        <#elseif "${attribute[1]}" == "1" && "${attribute[2]}" == "Integer">
            <td><input class="reqinteger niceinput" name="values" type="text"/> </td>
        <#elseif "${attribute[1]}" == "0" && "${attribute[2]}" == "Integer">
            <td><input class="optinteger niceinput" name="values" type="text"/> </td>
        <#elseif "${attribute[1]}" == "0" && "${attribute[2]}" == "Double">
            <td><input class="optdouble niceinput" name="values" type="text"/> </td>
        </#if>
        
        <#if "${attribute[1]}" == "1">
            <td class="noborder"> * </td>
        </#if>
    </tr>
</#list>
    <tr class="file">
         <@ww.file name="image" label="File"/>
    <tr>
        <td class="bottom fright" colspan="2"><input type="submit" value="Add Product" /></td>
    </tr>
</table>
</form>
<script type="text/javascript" src="/Carrello/js/addproduct.js"></script>
<#include "*/general/footer.ftl">